
const TokenKey = 'hm-slwl-tonken'
const userInfoKey = 'hm-slwl-userInfo'
// 保存token到本地存储中
export function getToken() {
  return localStorage.getItem(TokenKey)
}

export function setToken(token) {
  localStorage.setItem(TokenKey, token)
}

export function removeToken() {
  localStorage.removeItem(TokenKey)
}
// 保存userInfo到本地存储中
export function getUserInfo() {
  return JSON.parse(localStorage.getItem(userInfoKey))
}

export function setUserInfo(userInfo) {
  localStorage.setItem(userInfoKey, JSON.stringify(userInfo))
}

export function removeUserInfo() {
  localStorage.removeItem(userInfoKey)
}

